# !/usr/bin/python3
# -*- coding: utf-8 -*-
"""
功能描述
----------------------------------------------------
@Project :   xinhou-openai-framework
@File    :   IndexController.py    
@Contact :   sp_hrz@qq.com

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/3/28 15:39   shenpeng   1.0         None
"""
from fastapi import APIRouter
from fastapi.params import Depends
from loguru import logger
from sqlalchemy.orm import Session

from apps.admin.schema.UserSchema import ReqUserFindSchema
from xinhou_openai_framework.core.db.DatabaseManager import DatabaseManager
from xinhou_openai_framework.core.reponse.R import R

api = APIRouter()


@api.post("/admin/index/dashboard",
          tags=["admin", "index"],
          summary="获取首页dashboard信息接口",
          description="获取首页dashboard信息，用于后台首页的展示")
async def admin_index_dashboard(
        model: ReqUserFindSchema,
        db: Session = Depends(DatabaseManager().get_session)
):
    logger.info("[admin_index_dashboard][request]:{}".format(model.json()))
    return R.SUCCESS()


@api.post("/admin/index/tree_menu",
          tags=["admin", "index"],
          summary="树形菜单信息接口",
          description="树形菜单信息，用于渲染后台的功能菜单")
async def admin_index_tree_menu(
        model: ReqUserFindSchema,
        db: Session = Depends(DatabaseManager().get_session)
):
    logger.info("[admin_index_dashboard][request]:{}".format(model.json()))
    return R.SUCCESS()
